/*
 * @Project_description: 菜单api
 */

export default ({ request }) => ({
  //查询单个
  find(params) {
    return request({
      url: 'permission/findPerById',
      method: 'get',
      params,
    })
  },
  //修改
  put(data) {
    return request({
      url: 'permission/updatePermisson',
      method: 'post',
      data,
    })
  },
  //添加单个
  add(data) {
    return request({
      url: 'permission/createPerInfo',
      method: 'post',
      data,
    })
  },
  // 树查询
  tree() {
    return request({
      url: 'permission/findAllPerTree',
      method: 'get',
    })
  },
  // 查询当前用户的权限树
  userTree() {
    return request({
      url: 'permission/findCurrentUserPerTree',
      method: 'get',
    })
  },
  //删除
  del(params) {
    return request({
      url: 'permission/delPerById',
      method: 'get',
      params,
    })
  },
})
